﻿using System;
using System.Web;
using System.Web.UI;

namespace Developmentalmadness.Web.UI.AjaxAbstractions
{

    /*
     * These interfaces are simply for convenience in authoring classes, they
     * allow VS.NET to author all the method stubs for us.
     */

    internal interface IClientUrlResolver
    {
        // Methods
        string ResolveClientUrl(string relativeUrl);
    }

    internal interface IScriptManager
    {
        // Methods
        void RegisterArrayDeclaration(Control control, string arrayName, string arrayValue);
        void RegisterClientScriptBlock(Control control, Type type, string key, string script, bool addScriptTags);
        void RegisterClientScriptInclude(Control control, Type type, string key, string url);
        void RegisterClientScriptResource(Control control, Type type, string resourceName);
        void RegisterDispose(Control control, string disposeScript);
        void RegisterExpandoAttribute(Control control, string controlId, string attributeName, string attributeValue, bool encode);
        void RegisterHiddenField(Control control, string hiddenFieldName, string hiddenFieldValue);
        void RegisterOnSubmitStatement(Control control, Type type, string key, string script);
        void RegisterPostBackControl(Control control);
        void RegisterStartupScript(Control control, Type type, string key, string script, bool addScriptTags);
        void SetFocus(Control control);
        void SetFocus(string clientID);
        void RegisterAsyncPostBackControl(Control control);
        void RegisterExtenderControl<TExtenderControl>(TExtenderControl extenderControl, Control targetControl) where TExtenderControl : Control, IExtenderControl;
        void RegisterProxy(ScriptManagerProxy proxy);
        void RegisterScriptControl<TScriptControl>(TScriptControl scriptControl) where TScriptControl : Control, IScriptControl;
        void RegisterScriptDescriptors(IExtenderControl extenderControl);
        void RegisterScriptDescriptors(IScriptControl scriptControl);
        void RegisterUpdatePanel(UpdatePanel updatePanel);
        void UnregisterUpdatePanel(UpdatePanel updatePanel);

        // Properties
        bool IsInAsyncPostBack { get; }
        bool SupportsPartialRendering { get; }
        string AsyncPostBackSourceElementID { get; }
    }

}
